package com.wyw.design.model.learning.structure.filter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Title   干垃圾——ConcreteFilter
 * @Description 具体的过滤
 * @Author Mr Wu yewen.wu.china@gmail.com
 * Update History:
 * Author        Time            Content
 */
public class DryRubbishCriteria implements Criteria{

    @Override
    public List<Rubbish> rubbishFilter(List<Rubbish> rubbishes) {
        List<Rubbish> rubbishList = new ArrayList<>();
        for (Rubbish rubbish: rubbishes) {
            // 这里只过滤出所有干垃圾
            if (rubbish.isDry()) {
                rubbishList.add(rubbish);
            }
        }
        return rubbishList;
    }
}
